﻿using System.ComponentModel;
using System.Xml;
using System.Xml.Serialization;

namespace Bpmn.Xml;

/// <remarks/>
[Serializable]
[XmlType(Namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", TypeName = "tDefinitions")]
[XmlRoot("definitions", Namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", IsNullable = false)]
public partial class Definitions
{
    /// <remarks/>
    [XmlElement("import")]
    public Import[] Import { get; set; } = default!;

    /// <remarks/>
    [XmlElement("extension")]
    public Extension[] Extension { get; set; } = default!;

    /// <remarks/>
    [XmlElement("category", typeof(Category))]
    [XmlElement("collaboration", typeof(Collaboration))]
    [XmlElement("correlationProperty", typeof(CorrelationProperty))]
    [XmlElement("dataStore", typeof(DataStore))]
    [XmlElement("endPoint", typeof(EndPoint))]
    [XmlElement("error", typeof(Error))]
    [XmlElement("escalation", typeof(Escalation))]
    [XmlElement("eventDefinition", typeof(EventDefinition))]
    [XmlElement("globalBusinessRuleTask", typeof(GlobalBusinessRuleTask))]
    [XmlElement("globalManualTask", typeof(GlobalManualTask))]
    [XmlElement("globalScriptTask", typeof(GlobalScriptTask))]
    [XmlElement("globalTask", typeof(GlobalTask))]
    [XmlElement("globalUserTask", typeof(GlobalUserTask))]
    [XmlElement("interface", typeof(Interface))]
    [XmlElement("itemDefinition", typeof(ItemDefinition))]
    [XmlElement("message", typeof(Message))]
    [XmlElement("partnerEntity", typeof(PartnerEntity))]
    [XmlElement("partnerRole", typeof(PartnerRole))]
    [XmlElement("process", typeof(Process))]
    [XmlElement("resource", typeof(Resource))]
    [XmlElement("rootElement", typeof(RootElement))]
    [XmlElement("signal", typeof(Signal))]
    public RootElement[] Items { get; set; } = default!;

    /// <remarks/>
    [XmlElement("BPMNDiagram", Namespace = "http://www.omg.org/spec/BPMN/20100524/DI")]
    public BpmnDiagram[] BpmnDiagram { get; set; } = default!;

    /// <remarks/>
    [XmlElement("relationship")]
    public Relationship[] Relationship { get; set; } = default!;

    /// <remarks/>
    [XmlAttribute("id", DataType = "ID")]
    public string Id { get; set; } = default!;

    /// <remarks/>
    [XmlAttribute("name")]
    public string Name { get; set; } = default!;

    /// <remarks/>
    [XmlAttribute("targetNamespace", DataType = "anyURI")]
    public string TargetNamespace { get; set; } = default!;

    /// <remarks/>
    [XmlAttribute("expressionLanguage", DataType = "anyURI")]
    [DefaultValue("http://www.w3.org/1999/XPath")]
    public string ExpressionLanguage { get; set; } = "http://www.w3.org/1999/XPath";

    /// <remarks/>
    [XmlAttribute("typeLanguage", DataType = "anyURI")]
    [DefaultValue("http://www.w3.org/2001/XMLSchema")]
    public string TypeLanguage { get; set; } = "http://www.w3.org/2001/XMLSchema";

    /// <remarks/>
    [XmlAttribute("exporter")]
    public string Exporter { get; set; } = default!;

    /// <remarks/>
    [XmlAttribute("exporterVersion")]
    public string ExporterVersion { get; set; } = default!;

    /// <remarks/>
    [XmlAnyAttribute]
    public XmlAttribute[] AnyAttr { get; set; } = default!;
}
